<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="MailSchedule.aspx.vb" Inherits="WebForm_Mail_MailSchedule" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:HiddenField ID="hiUID" runat="server" />
    <asp:HiddenField ID="hiDBName" runat="server" />
    <asp:ObjectDataSource ID="dsAssetType" runat="server" SelectMethod="GetAssetType"
        TypeName="AssetManage.BBL.AssetBBL">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="kind" Type="String" />
            <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="dsDeptID" runat="server" SelectMethod="GetDept" TypeName="OAMS.BBL.UsersBBL">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="kind" Type="String" />
            <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <table border="1">
        <tr>
            <td colspan="2" style="text-align: center">
                <asp:Label ID="lblTitle" runat="server" meta:resourcekey="lblTitle" Font-Bold="True"
                    Font-Size="24px"></asp:Label>
            </td>
        </tr>
        <tr style="vertical-align: text-top">
            <td>
                <ajaxToolkit:TabContainer ID="tcMain" runat="server" ActiveTabIndex="0" Width="100%"
                    AutoPostBack="True">
                    <ajaxToolkit:TabPanel ID="QueryPanel" runat="server" meta:resourcekey="QueryPanel">
                        <ContentTemplate>
                            <asp:Label ID="lblScheduleType1" runat="server" meta:resourcekey="lblScheduleType"></asp:Label>
                            <asp:DropDownList ID="ddlScheduleType1" runat="server">
                                <asp:ListItem></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ScheduleType1"></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ScheduleType2"></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ScheduleType3"></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ScheduleType4"></asp:ListItem>
                            </asp:DropDownList>
                            <br />
                            <asp:Label ID="lblAssetType1" runat="server" meta:resourceKey="lblAssetType"></asp:Label>
                            <asp:DropDownList ID="ddlAssetType1" runat="server" DataSourceID="dsAssetType" DataTextField="name"
                                DataValueField="id">
                            </asp:DropDownList>
                            <br />
                            <asp:Label ID="Label1" runat="server" meta:resourceKey="lblDeptID"></asp:Label>
                            <asp:TextBox ID="txtDept0" runat="server" Width="60px"></asp:TextBox>
                            <asp:LinkButton ID="btnDept0" runat="server">...</asp:LinkButton>
                            <br />
                            <asp:Button ID="btnQuery" meta:resourceKey="btnQuery" runat="server" />
                            <br />
                            <asp:ObjectDataSource ID="dsSendMail" runat="server" DeleteMethod="DeleteSendMail"
                                SelectMethod="GetSendMail" TypeName="AssetManage.BBL.MailBBL">
                                <DeleteParameters>
                                    <asp:Parameter Name="SerNo" Type="Int32" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                                </DeleteParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlScheduleType1" Name="ScheduleType" PropertyName="SelectedValue"
                                        Type="String" ConvertEmptyStringToNull="False" />
                                    <asp:ControlParameter ControlID="ddlAssetType1" Name="AssetType" PropertyName="SelectedValue"
                                        Type="String" ConvertEmptyStringToNull="False" />
                                    <asp:ControlParameter ControlID="txtDept0" ConvertEmptyStringToNull="False" Name="DeptNo"
                                        PropertyName="Text" Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <TServerControl:TGridView ID="gvSendMail" runat="server" AllowHoverEffect="False"
                                AllowHoverSelect="False" AllowPaging="True" DataSourceID="dsSendMail" ShowFooterWhenEmpty="False"
                                ShowHeaderWhenEmpty="False" SkinID="pager" TotalRowCount="0" AutoGenerateColumns="False"
                                DataKeyNames="SerNo">
                                <EmptyDataTemplate>
                                    <asp:Label ID="lblEmpty" runat="server" ForeColor="Red" meta:resourcekey="lblEmpty"></asp:Label>
                                </EmptyDataTemplate>
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Button ID="btnEdit" runat="server" CommandName="Edit1" meta:resourcekey="btnEdit"
                                                Visible='<%# Bind("canModi") %>' CommandArgument='<%# Bind("SerNo") %>' />
                                            <br />
                                            <asp:Button ID="btnDelete" runat="server" CommandName="Delete" meta:resourcekey="btnDelete"
                                                Visible='<%# Bind("canModi") %>' />
                                        </ItemTemplate>
                                        <ItemStyle Wrap="False" />
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colSerNo">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSerNo" runat="server" Text='<%# Bind("SerNo") %>' Width="100px"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colMailSubject">
                                        <ItemTemplate>
                                            <asp:Label ID="lblMailSubject" runat="server" Text='<%# Bind("MailSubject") %>' Width="100px"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colMailBody">
                                        <ItemTemplate>
                                            <asp:Label ID="lblMailBody" runat="server" Text='<%# Bind("MailBody") %>' Width="200px"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colTopN">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTopN" runat="server" Text='<%# Bind("TopN") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colDeptNo">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDeptNo1" runat="server" Text='<%# Bind("DeptNo1") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colEquQty">
                                        <ItemTemplate>
                                            <asp:Label ID="lblEquQty" runat="server" Text='<%# Bind("EquQty") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colSendDate">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSendDate" runat="server" Text='<%# Bind("SendDate","{0:d}") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colTakeOfficeDate">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTakeOfficeDate" runat="server" Text='<%# Bind("TakeOfficeDate","{0:d}") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colReturnDays">
                                        <ItemTemplate>
                                            <asp:Label ID="lblReturnDays" runat="server" Text='<%# Bind("ReturnDays") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colResendDays">
                                        <ItemTemplate>
                                            <asp:Label ID="lblResendDays" runat="server" Text='<%# Bind("ResendDays") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colHouseID">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="ddlHouseID" runat="server" SelectedValue='<%# Bind("HouseID") %>'
                                                Enabled="False">
                                                <asp:ListItem meta:resourcekey="HouseID0"></asp:ListItem>
                                                <asp:ListItem meta:resourcekey="HouseID1"></asp:ListItem>
                                                <asp:ListItem meta:resourcekey="HouseID2"></asp:ListItem>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="colStatus">
                                        <ItemTemplate>
                                            <asp:DropDownList ID="ddlStatus" runat="server" SelectedValue='<%# Bind("Status") %>'
                                                Enabled="False">
                                                <asp:ListItem meta:resourcekey="StatusY"></asp:ListItem>
                                                <asp:ListItem meta:resourcekey="StatusN"></asp:ListItem>
                                                <asp:ListItem meta:resourcekey="StatusP"></asp:ListItem>
                                                <asp:ListItem meta:resourcekey="StatusR"></asp:ListItem>
                                                <asp:ListItem meta:resourcekey="StatusD"></asp:ListItem>
                                            </asp:DropDownList>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </TServerControl:TGridView>
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
                    <ajaxToolkit:TabPanel ID="GeneralPanel" runat="server" meta:resourcekey="GeneralPanel">
                        <ContentTemplate>
                            <table border="1">
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblSerNo1" runat="server" meta:resourcekey="lblSerNo" Width="100px"></asp:Label>
                                    </td>
                                    <td colspan="3">
                                        <asp:Label ID="lblSerNo" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblParamID" runat="server" meta:resourcekey="lblParamID"></asp:Label>
                                    </td>
                                    <td colspan="3">
                                        <asp:ObjectDataSource ID="dsMailParam" runat="server" SelectMethod="GetMailParamItem"
                                            TypeName="AssetManage.BBL.MailParamBBL">
                                            <SelectParameters>
                                                <asp:Parameter DefaultValue="0" Name="kind" Type="String" />
                                                <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                                            </SelectParameters>
                                        </asp:ObjectDataSource>
                                        <asp:DropDownList ID="ddlParamID" runat="server" DataSourceID="dsMailParam" DataTextField="ParamDesc"
                                            DataValueField="ParamID" AutoPostBack="True">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    
                                      <td colspan="4">
                                        <ajaxToolkit:TabContainer ID="tbBody" runat="server" ActiveTabIndex="0" CssClass="">
                                            <ajaxToolkit:TabPanel ID="tbCht" runat="server" meta:resourceKey="tbCht">
                                                <ContentTemplate>
                                                    <table>
                                                        <tr>
                                                            <td align="right">
                                                                <asp:Label ID="lblMailSubject" runat="server" meta:resourceKey="lblMailSubject"></asp:Label>
                                                            </td>
                                                            <td align="left">
                                                                <asp:TextBox ID="txtMailSubject" runat="server" Width="700px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        
                                                        <tr>
                                                            <td align="right">
                                                                <asp:Label ID="lblMailBody" runat="server" meta:resourceKey="lblMailBody"></asp:Label>
                                                            </td>
                                                            <td align="left" colspan="5">
                                                                <FCKeditorV2:FCKeditor ID="txtMailBody" runat="server" BasePath="~/FCKeditor/" Height="200px"
                                                                    Width="800px" ToolbarSet="ori_Default">
                                                                </FCKeditorV2:FCKeditor>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ContentTemplate>
                                            </ajaxToolkit:TabPanel>
                                            <ajaxToolkit:TabPanel ID="tbSimplified" runat="server" meta:resourcekey="tbsimplified">
                                                <ContentTemplate>
                                                    <table border="1">
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblMailsubjectSimplified" runat="server" meta:resourceKey="lblMailsubjectSimplified"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtMailsubjectSimplified" runat="server" Width="500px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                       
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblMailBodySimplified" runat="server" meta:resourceKey="lblMailBodySimplified"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <FCKeditorV2:FCKeditor ID="txtMailBodyChn" runat="server" BasePath="~/FCKeditor/"
                                                                    Height="200px" Width="800px" ToolbarSet="ori_Default">
                                                                </FCKeditorV2:FCKeditor>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ContentTemplate>
                                            </ajaxToolkit:TabPanel>
                                            <ajaxToolkit:TabPanel ID="tbEnglish" runat="server" meta:resourcekey="tbEnglish">
                                                <ContentTemplate>
                                                    <table border="1">
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblMailsubjectEng" runat="server" meta:resourceKey="lblMailsubjectEng"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtMailSubjectEng" runat="server" Width="500px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                       
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblMailBodyEng" runat="server" meta:resourceKey="lblMailBodyEng"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <FCKeditorV2:FCKeditor ID="txtMailBodyEng" runat="server" BasePath="~/FCKeditor/"
                                                                    Height="200px" Width="800px" ToolbarSet="ori_Default">
                                                                </FCKeditorV2:FCKeditor>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ContentTemplate>
                                            </ajaxToolkit:TabPanel>
                                        </ajaxToolkit:TabContainer>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblScheduleType" runat="server" meta:resourcekey="lblScheduleType"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlScheduleType" runat="server" AutoPostBack="True">
                                            <asp:ListItem meta:resourcekey="ScheduleType1"></asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ScheduleType2"></asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ScheduleType3"></asp:ListItem>
                                            <asp:ListItem meta:resourcekey="ScheduleType4"></asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:DropDownList ID="ddlMonth" runat="server">
                                            <asp:ListItem></asp:ListItem>
                                            <asp:ListItem>1</asp:ListItem>
                                            <asp:ListItem>2</asp:ListItem>
                                            <asp:ListItem>3</asp:ListItem>
                                            <asp:ListItem>4</asp:ListItem>
                                            <asp:ListItem>5</asp:ListItem>
                                            <asp:ListItem>6</asp:ListItem>
                                            <asp:ListItem>7</asp:ListItem>
                                            <asp:ListItem>8</asp:ListItem>
                                            <asp:ListItem>9</asp:ListItem>
                                            <asp:ListItem>10</asp:ListItem>
                                            <asp:ListItem>11</asp:ListItem>
                                            <asp:ListItem>12</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:Label ID="lblMonth" runat="server" meta:resourcekey="lblMonth"></asp:Label>
                                        <asp:DropDownList ID="ddlDay" runat="server">
                                            <asp:ListItem></asp:ListItem>
                                            <asp:ListItem>1</asp:ListItem>
                                            <asp:ListItem>2</asp:ListItem>
                                            <asp:ListItem>3</asp:ListItem>
                                            <asp:ListItem>4</asp:ListItem>
                                            <asp:ListItem>5</asp:ListItem>
                                            <asp:ListItem>6</asp:ListItem>
                                            <asp:ListItem>7</asp:ListItem>
                                            <asp:ListItem>8</asp:ListItem>
                                            <asp:ListItem>9</asp:ListItem>
                                            <asp:ListItem>10</asp:ListItem>
                                            <asp:ListItem>11</asp:ListItem>
                                            <asp:ListItem>12</asp:ListItem>
                                            <asp:ListItem>13</asp:ListItem>
                                            <asp:ListItem>14</asp:ListItem>
                                            <asp:ListItem>15</asp:ListItem>
                                            <asp:ListItem>16</asp:ListItem>
                                            <asp:ListItem>17</asp:ListItem>
                                            <asp:ListItem>18</asp:ListItem>
                                            <asp:ListItem>19</asp:ListItem>
                                            <asp:ListItem>20</asp:ListItem>
                                            <asp:ListItem>21</asp:ListItem>
                                            <asp:ListItem>21</asp:ListItem>
                                            <asp:ListItem>22</asp:ListItem>
                                            <asp:ListItem>23</asp:ListItem>
                                            <asp:ListItem>24</asp:ListItem>
                                            <asp:ListItem>25</asp:ListItem>
                                            <asp:ListItem>26</asp:ListItem>
                                            <asp:ListItem>27</asp:ListItem>
                                            <asp:ListItem>28</asp:ListItem>
                                            <asp:ListItem>29</asp:ListItem>
                                            <asp:ListItem>30</asp:ListItem>
                                            <asp:ListItem>31</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:Label ID="lblDay" runat="server" meta:resourcekey="lblDay"></asp:Label>
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblTopN" runat="server" meta:resourcekey="lblTopN"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTopN" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblDeptID" runat="server" meta:resourceKey="lblDeptID"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlDeptID2" runat="server" DataSourceID="dsDeptID" DataTextField="DeptName"
                                            DataValueField="DeptID" Visible="False">
                                        </asp:DropDownList>
                                        <asp:TextBox ID="txtDept" runat="server" Width="60px"></asp:TextBox>
                                        <asp:LinkButton ID="btnDept" runat="server">...</asp:LinkButton>
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblEquQty" runat="server" meta:resourceKey="lblEquQty"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEquQty" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblSendDate" runat="server" meta:resourceKey="lblSendDate"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtSendDate" runat="server" Width="70px"></asp:TextBox>
                                        <ajaxToolkit:CalendarExtender ID="txtSendDate_CalendarExtender" runat="server" TargetControlID="txtSendDate"
                                            Format="yyyy/MM/dd" Enabled="True">
                                        </ajaxToolkit:CalendarExtender>
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblTakeOfficeDate" runat="server" meta:resourceKey="lblTakeOfficeDate"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTakeOfficeDate" runat="server" Width="70px"></asp:TextBox>
                                        <ajaxToolkit:CalendarExtender ID="txtTakeOfficeDate_CalendarExtender" runat="server"
                                            TargetControlID="txtTakeOfficeDate" Format="yyyy/MM/dd" Enabled="True">
                                        </ajaxToolkit:CalendarExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="width: 10%">
                                        <asp:Label ID="lblReturnDays" runat="server" meta:resourceKey="lblReturnDays"></asp:Label>
                                    </td>
                                    <td style="width: 50%">
                                        <asp:TextBox ID="txtReturnDays" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                    <td align="right" style="width: 10%">
                                        <asp:Label ID="lblResendDays" runat="server" meta:resourceKey="lblResendDays"></asp:Label>
                                    </td>
                                    <td style="width: 30%">
                                        <asp:TextBox ID="txtResendDays" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="width: 10%">
                                        <asp:Label ID="lblHouseID" runat="server" meta:resourceKey="lblHouseID"></asp:Label>
                                    </td>
                                    <td style="width: 50%">
                                        <asp:DropDownList ID="ddlHouseID" runat="server">
                                            <asp:ListItem meta:resourcekey="HouseID0"></asp:ListItem>
                                            <asp:ListItem meta:resourcekey="HouseID1"></asp:ListItem>
                                            <asp:ListItem meta:resourcekey="HouseID2"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblResendTimes" runat="server" meta:resourceKey="lblResendTimes"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtResendTimes" runat="server" Width="70px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="width: 10%">
                                        <asp:Label ID="lblAssetType" runat="server" meta:resourceKey="lblAssetType"></asp:Label>
                                    </td>
                                    <td style="width: 50%">
                                        <asp:DropDownList ID="ddlAssetType" runat="server" DataSourceID="dsAssetType" DataTextField="name"
                                            DataValueField="id">
                                        </asp:DropDownList>
                                    </td>
                                    <td align="right" style="width: 10%">
                                        .
                                    </td>
                                    <td style="width: 30%">
                                        .
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4" align="center">
                                        <asp:Button ID="btnSave" runat="server" meta:resourceKey="btnSave" Visible="False" />
                                        <asp:Button ID="btnNew" runat="server" meta:resourceKey="btnNew" Visible="False" />
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
                </ajaxToolkit:TabContainer>
            </td>
            <td>
            </td>
        </tr>
    </table>
</asp:Content>
